<?php

namespace App\Admin\Forms;

use Dcat\Admin\Widgets\Form;

class ZfForm extends Form
{
    /**
     * Handle the form request.
     *
     * @param array $input
     *
     * @return mixed
     */
    public function handle(array $input)
    {
        // dump($input);
        admin_setting($input);
        // return $this->response()->error('Your error message.');

        return $this
				->response()
				->success('保存成功')
				->refresh();
    }

    /**
     * Build a form here.
     */
    public function form()
    {
        $this->select('audit')->options([
            '0' => '关闭',
            '1' => '开启',
          
        ])->default(admin_setting('audit', '0'))->label('域名审核');
        $this->select('domain_add_check')->options([
            '0' => '关闭',
            '1' => '开启',
          
        ])->default(admin_setting('domain_add_check', '0'))->label('解析检测');
    }

    /**
     * The data of the form.
     *
     * @return array
     */
    public function default()
    {
        return [
            'recharge'  => admin_setting('recharge')

        ];
    }
}
